<%--
  Created by IntelliJ IDEA.
  User: Zoro
  Date: 2022/3/12
  Time: 11:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="header.jsp" %>
<html>
<head>
    <title>新增书籍</title>
</head>

<style>
    .redStar::before {
        content: "*";
        color: red;
    }
</style>
<body>
<h1 class="col-md-3 col-md-offset-5">新增电子文档</h1>
<div class="container col-md-4 col-md-offset-4">
    <form action="/entry/add" onsubmit="return check()">
        <div class="form-group">
            <label for="title" class="redStar">文档名称</label>
            <input type="text" class="form-control req" name="eTitle" id="title" placeholder="title">
        </div>
        <div class="form-group">
            <label for="summary">文档摘要</label>
            <textarea rows="3" class="form-control" name="eSummary" id="summary" placeholder="summary"></textarea>
        </div>
        <div class="form-group">
            <label for="uploaduser">上传人</label>
            <input type="text" class="form-control" name="eUploadUser" id="uploaduser" placeholder="uploaduser">
        </div>
        <div class="form-group">
            <label for="createDate" class="redStar">上传时间</label>
            <input type="date" class="form-control" name="eCreateDate" id="createDate" placeholder="createDate">
        </div>
        <div class="col-md-1 col-md-offset-5">
            <input type="submit" id="sub" class="btn btn-default" value="提交"/>
        </div>
    </form>
</div>

<script>

    function check() {
        if ($("#title").val() == '') {
            alert("请填写带*号的选项")
            return false;
        } else if ($("#createDate").val() == '') {
            alert("请填写带*号的选项")
            return false;
        } else {
            return true;
        }
    }


</script>
</body>
</html>
